package cn.smartinvoke.web;

import java.util.HashMap;
import java.util.Map;

import org.smartinvoke.web.exception.ActionException;

public class SmartActionManager {
   private static Map<String,Class> actionTypes=new HashMap<String, Class>();
   
   public static void addActionType(Class type){
	   actionTypes.put(type.getName(), type);
   }
   public static Class getActionType(String typeName){
	   Class ret= actionTypes.get(typeName);
	   if(ret==null){
		   throw new ActionException(ActionException.Type_Not_Register);
	   }
	   return ret;
   }
   public static void removeActionType(String typeName) {
	   actionTypes.remove(typeName);
   }
   
}
